package com.lxl.settings.dao;


import com.lxl.settings.entity.User;
import javax.servlet.jsp.jstl.sql.Result;
import java.sql.SQLException;

/**
 * @author 北上寻海
 */
public interface UserDao {
    /**
     * 登录的查询
     * @param username 用户名
     * @param password 密码
     * @return 用result替代ResultSet作返回值，因为ResultSet对象要关闭
     * @throws SQLException sql异常上抛
     */
    Result selectUserByCondition(String username, String password) throws SQLException;

    /**
     * 添加user
     * @param user 待添加的user
     * @return int
     * @throws SQLException sql异常
     */
    int insertUserByCondition(User user) throws SQLException;


    /**
     *
     * 根据id查用户
     * @param id 用户id
     * @return 结果集
     * @throws SQLException sql
     */
    Result selectUserById(String id) throws SQLException;
}
